import { app, ipcMain, dialog } from 'electron'
console.log('TCL: electron', ipcMain)

ipcMain.on('open-directory-dialog', function (event, p) {
    dialog.showOpenDialog({
        properties: [...p]
    }, function (files) {
        console.log('TCL: files', files, [...p])

        if (files) {// 如果有选中
            // 发送选择的对象给子进程
            // event.reply('open-directory-dialog-reply', files[0])
            event.sender.send('open-directory-dialog-reply', files[0])
        }
    })
})
